﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace MadPropsDemo
{
    public class Screen
    {
        public FrameworkElement View { get; private set; }
        public object ViewModel { get; private set; }

        public Screen(FrameworkElement view, object viewModel)
        {
            this.View = view.ThrowIfNull("view");
            this.ViewModel = viewModel.ThrowIfNull("viewModel");
            view.DataContext = viewModel;

            var nameSpace = viewModel.GetType().Namespace;
            DisplayName = nameSpace.Substring(nameSpace.LastIndexOf(".") + 1);
        }

        public string DisplayName { get; set; }
    }
}
